import { Upload, message, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import React from 'react'
const props = {
    beforeUpload: file => {
        const isPNG = file.type === 'image/jpeg';
        if (!isPNG) {
            message.error(`${file.name} 不是jpg或jpeg格式!`,3);
        }
        return isPNG || Upload.LIST_IGNORE;
    },
    name: 'file',
    action: 'http://localhost:8080/saveGiftPhoto',
    headers: {
        authorization: 'authorization-text',
    },
    maxCount: 1,
    onChange(info) {
        if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
        }
        if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`,3);
        } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`,3);
        }
    },
};
export default function index(props) {
    return (
        // <Upload {...props} multiple={false} maxCount={1}>
        //     <Button icon={<UploadOutlined />}></Button>
        // </Upload>
        <></>
    )
}
